import {
	dayjs
} from '@/uni_modules/iRainna-dayjs/js_sdk/dayjs.min.js'
export {
	dayjs
}
export function getTimeBetween(startDate, endDate) { //传入的格式YYYY-MM-DD
	let daysList = [];
	let SDate = dayjs(startDate);
	let EDate = dayjs(endDate);
	let currentDate = SDate;
	daysList.push(SDate.format("YYYY-MM-DD"));
	while (currentDate < EDate) { // 注意这里add方法处理后SDate对象已经改变。      
		daysList.push(currentDate.format("YYYY-MM-DD"));
		currentDate = currentDate.add(1, "days");
	}
	daysList.push(EDate.format("YYYY-MM-DD"));
	return daysList;
}

export function filterData(data, field = 'date') {
	let newObj = {},
		newArr = []
	data.forEach(item => {
		if (!newObj[item[field]]) {
			newObj[item[field]] = newArr.push(item)
		}
	})
	return newArr

}


export const actionTypeList = [{
		label: '日程',
		value: '0',
		checked: false
	},
	{
		label: '流程',
		value: '2',
		checked: false,
	},
	// {
	//   label: '计划',
	//   value: '计划',
	// },
	// {
	//   label: '通知',
	//   value: '通知',
	// },
]